﻿<%@ Page Title="" Language="C#" MasterPageFile="~/main.master" AutoEventWireup="true" CodeFile="register.aspx.cs" Inherits="register" %>
<asp:Content ID="Contenthead" ContentPlaceHolderID="ContentHead" runat="server">
      
    <script src="js/jquery-1.4.2.js" type="text/javascript"></script>
    <script type="text/javascript">
        function getvcode() {
                $("#vcode").attr("src","ValidateCode.ashx?id="+new Date());
            }
            $(function () {
                $("#<%=txtName.ClientID %>").blur(function () {
                    var username = $(this).val();
                    $.post("IsExistOrNot.ashx", { "name": username }, function (data) {
                        if (data == "yes") {
                            $("#isornot").html('<font color="red">用户已存在！</font>');
                        } else {
                            $("#isornot").html("");
                        };
                    });
                });
            });
    </script>  
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">

 <div style="font-size:small; width:600px; text-align:center; margin:0 auto;">
 <center>
  <table width="480px" height="22" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td style="width: 10px"><img src="images/az-tan-top-left-round-corner.gif" width="10" height="28" /></td>
    <td bgcolor="#DDDDCC"><span class="STYLE1">注册新用户</span></td>
    <td width="10"><img src="images/az-tan-top-right-round-corner.gif" width="10" height="28" /></td>
  </tr>
</table>


<table width="480px" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="2" bgcolor="#DDDDCC">&nbsp;</td>
    <td><div align="center">
      <table cellpadding="0" cellspacing="0" style="height: 320px">
        <tr>
          <td height="33" colspan="2"><p style="text-align: center">注册新帐户方便又容易</p></td>
        </tr>
        <tr>
          <td width="24%" align="center" valign="top" style="height: 26px">用户名：</td>
          <td valign="top" width="37%" align="left" style="height: 26px;">
              <asp:TextBox ID="txtName" runat="server" Width="148px"></asp:TextBox> 
              <span id="isornot"></span>  
             <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                  ErrorMessage="用户名不能为空" ControlToValidate="txtName" Display="Dynamic" 
                  ForeColor="Red"></asp:RequiredFieldValidator>
              </td> 
                   
        </tr>
    
        <tr>
          <td width="24%" height="26" align="center" valign="top">密码：</td>
          <td valign="top" width="37%" align="left">
              <asp:TextBox ID="txtPwd" runat="server" TextMode="Password" Width="148px"></asp:TextBox>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                  ErrorMessage="密码不能为空" ControlToValidate="txtPwd" ForeColor="Red" 
                  Display="Dynamic"></asp:RequiredFieldValidator>
              <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                  ControlToValidate="txtPwd" ErrorMessage="密码格式不对" ForeColor="Red" 
                  ValidationExpression="^[\@A-Za-z0-9\!\#\$\%\^\&amp;\*\.\~]{6,22}$" 
                  Display="Dynamic"></asp:RegularExpressionValidator>
                  6-22位
            </td>          
        </tr>
        <tr>
          <td width="24%" height="26" align="center" valign="top">确认密码：</td>
          <td valign="top" width="37%" align="left">
              <asp:TextBox ID="txtPwd2" runat="server" TextMode="Password" Width="148px"></asp:TextBox>
              <asp:CompareValidator ID="CompareValidator1" runat="server" 
                  ControlToCompare="txtPwd2" ControlToValidate="txtPwd" 
                  ErrorMessage="密码不一致" ForeColor="Red"></asp:CompareValidator>
            </td>          
        </tr>





        <tr>
          <td width="24%" height="26" align="center" valign="top">密保问题：</td>
          <td valign="top" width="37%" align="left">
              <asp:DropDownList ID="ddlQuestion" runat="server" Width="152px">
                  <asp:ListItem Value="1">您小学的名字？</asp:ListItem>
                  <asp:ListItem Value="2">您最喜欢的地方？</asp:ListItem>
                  <asp:ListItem Value="3">您最喜欢的演员？</asp:ListItem>
              </asp:DropDownList>
            </td>          
        </tr>
        <tr>
          <td width="24%" height="26" align="center" valign="top">答案：</td>
          <td valign="top" width="37%" align="left">
              <input type="text" id="txtAnswer" runat="server" style="width:148px"/>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                  ControlToValidate="txtAnswer" ErrorMessage="不能为空" ForeColor="Red"></asp:RequiredFieldValidator>
            </td>          
        </tr>






         <tr>
          <td width="24%" align="center" valign="top" class="style1">Email：</td>
          <td valign="top" width="37%" align="left" class="style1">
              <asp:TextBox ID="txtEmail" runat="server" style="width:148px"></asp:TextBox>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                  ErrorMessage="Email不能为空" ControlToValidate="txtEmail" Display="Dynamic" 
                  ForeColor="Red"></asp:RequiredFieldValidator>
              <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                  ControlToValidate="txtEmail" Display="Dynamic" ErrorMessage="Email格式不正确" 
                  ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                  ForeColor="Red"></asp:RegularExpressionValidator>
             </td>          
        </tr>
        <tr>
          <td width="24%" height="26" align="center" valign="top">QQ：</td>
          <td valign="top" width="37%" align="left">
              <asp:TextBox ID="txtQQ" runat="server" style="width:148px"></asp:TextBox>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                  ErrorMessage="QQ不能为空" ControlToValidate="txtQQ" ForeColor="Red" 
                  Display="Dynamic"></asp:RequiredFieldValidator>
              <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                  ControlToValidate="txtQQ" ErrorMessage="格式不对" ForeColor="Red" 
                  ValidationExpression="\d{5,10}"></asp:RegularExpressionValidator>
            </td>          
        </tr>
        <tr>
          <td width="24%" height="26" align="center" valign="top">手机：</td>
          <td valign="top" width="37%" align="left">
              <asp:TextBox ID="txtPhone" runat="server" style="width:148px"></asp:TextBox>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                  ErrorMessage="手机不能为空" ControlToValidate="txtPhone" ForeColor="Red" 
                  Display="Dynamic"></asp:RequiredFieldValidator>
            </td>          
        </tr>
        <tr>
          <td width="24%" height="26" align="center" valign="top">
              验证码：</td>
          <td valign="top" width="37%" align="left">
              <asp:TextBox ID="txtVCode" runat="server" style="width:148px"></asp:TextBox>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                  ErrorMessage="验证码不能为空" ControlToValidate="txtVCode" ForeColor="Red"></asp:RequiredFieldValidator>
            </td>          
        </tr>
        <tr>
          <td colspan="2" align="center"><image id="vcode" src="ValidateCode.ashx">&nbsp;&nbsp;<a href="#" onclick="getvcode()">看不清,换一张</a></image></td>           
        </tr>
        <tr>
          <td colspan="2" align="center">
              <asp:ImageButton ID="ibtnReg" runat="server" 
                  ImageUrl="images/az-finish.gif" onclick="ibtnReg_Click" />
            </td>           
        </tr>
      </table>
      <div>---------------------------------------------------------</div>
    </div>	
    </td>
    <td width="2" bgcolor="#DDDDCC">&nbsp;</td>
  </tr>
</table>

<table width="80%" height="3" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="3" bgcolor="#DDDDCC">
        <img src="images/touming.gif" width="27" height="9" /></td>
  </tr>
</table>
</center>
</div>
</asp:Content>
